    internal class VideoDownLoader
    {
        public HttpClient Client { get; set; }

        public VideoDownLoader()
        {
            var handler = new HttpClientHandler()
            {
                UseCookies = true,
                Proxy = new WebProxy("")
            };
            Client = new HttpClient(handler);

            Client.DefaultRequestHeaders.Add("Accept", "*/*");
            Client.DefaultRequestHeaders.Add("Accept-Encoding", "gzip, deflate, br");
            Client.DefaultRequestHeaders.Add("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
            Client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) ");

            Client.DefaultRequestHeaders.Referrer = new Uri("www.baidu.com");
        }

        static readonly object _lock = new object();

        static decimal countSize = 0;
        public void GetVideo(string url,string name)
        {
            var html = Client.GetStringAsync(url).GetAwaiter().GetResult();

            List<string> urls = new List<string>();
            foreach (var item in html.Split('\n'))
            {
                if(!item.Contains("#") && item.Contains(".ts"))
                {
                    urls.Add(url.Replace(name, item));
                }
            }

            foreach (var item in urls)
            {
                var dd = Client.GetByteArrayAsync(item).GetAwaiter().GetResult();
                Console.WriteLine($"Thread is {Thread.CurrentThread.ManagedThreadId},{dd.Length}");
                lock (_lock)
                {
                    countSize += dd.Length;
                }

                Console.WriteLine($"Current size  {countSize/1024/1024} Mb");
            }
        }
    }

        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");

            string url = "https://vodplay.222.com/video.m3u8";

            VideoDownLoader videoDownLoader = new();

            for(int i = 0; i < 1; ++i)
            {
                Task.Run(() => {
                    while (true)
                    {
                        videoDownLoader.GetVideo(url, "video.m3u8");
                    }
                });
            }

            Console.ReadLine();
            Console.ReadLine();
        }